#!/bin/bash

sudo umount ${1}*

sudo fdisk -u=sectors $1 <<EOF
o
n
p
1
20480
1024000
n
p
2
1228800

t
1
c
a
1
w
EOF

sudo mkfs.vfat -F 32 -n "boot" ${1}1
sudo mkfs.ext2 -j -L "filesystem" ${1}2
sudo fsck.vfat ${1}1
sudo fsck.ext2 ${1}2

